<nz-spin *ngIf="loading"></nz-spin>

<ng-container *ngIf="!loading">
  <ng-container *ngFor="let type of Object.keys(columns);let columnIndex = index">
    <div class="cil__info-item-blocks bottom-columns">
      <app-info-row
        *ngFor="let column of columns[type]; let rowIndex = index;"
        [ifEdit]="isEdits[type][rowIndex]"
        [columns]="column"
        [rowIndex]="columnIndex"
        (active)="activeItem($event, rowIndex)"
      ></app-info-row>
    </div>
  </ng-container>
</ng-container>

<ng-template #operate let-rowIndex=rowIndex>
  <app-rest-edit
    [editing]="isEdits[Object.keys(fields)[rowIndex]][0]"
    (edit)="edit(Object.keys(fields)[rowIndex], 0)"
    (cancel)="cancel()"
    (submit)="submit()"
  ></app-rest-edit>
</ng-template>

<ng-template #auditSelect let-rowIndex=rowIndex>
  <nz-select nzMode="multiple" [(ngModel)]="valuesMap[Object.keys(fields)[rowIndex]]" style="width: 90%;">
    <nz-option *ngFor="let step of optionsMap[Object.keys(fields)[rowIndex]] | async" [nzLabel]="step.stepName" [nzValue]="step.stepID"></nz-option>
  </nz-select>
</ng-template>